﻿<UserControl x:Class="QuailDashboard.View.Controls.SelectEnvironmentControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:QuailControls="clr-namespace:QuailDashboard.View.Controls" 
    Width="450" Height="300">
    <Grid x:Name="LayoutRoot" Background="White" Loaded="LayoutRoot_Loaded">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border x:Name="borderBorder"
                Grid.Row="0"
                Grid.RowSpan="2"
                CornerRadius="5" 
				Background="White"
                BorderBrush="LightGray"
                BorderThickness="1"
                >
            <Border.Effect>
                <DropShadowEffect />
            </Border.Effect>
        </Border>
        <TextBlock Text="Select the environment to use" FontSize="18" FontWeight="Bold" Margin="10" Grid.Row="0" />
        <Grid x:Name="ListGrid" Grid.Row="1" Margin="10" >
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="35" x:Name="RowSave" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <ListBox x:Name="ListEnvironments" Grid.Row="0" Grid.Column="0">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Description}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right">
                <CheckBox Margin="0,5,0,5" Content="View All" VerticalAlignment="Center" IsChecked="{Binding ShowAllEnvironments, Mode=TwoWay}" />
                <Button Margin="5,5,0,5" Click="ButtonAdd_Click">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text=" Add " />
                        <Image
                                Stretch="None"
                                Source="{StaticResource IconAdd}"
                                Margin="0,0,5,0"
                                 />
                    </StackPanel>
                </Button>

                <Button Margin="5,5,0,5" Click="ButtonConfigure_Click">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text=" Configure " />
                        <Image
                                Stretch="None"
                                Source="{StaticResource IconConfigure}"
                                Margin="0,0,5,0"
                                 />
                    </StackPanel>
                </Button>
                
                <Button Margin="5,5,0,5" Click="ButtonSave_Click">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text=" Select " />
                        <Image
                                Stretch="None"
                                Source="{StaticResource IconSave}"
                                Margin="0,0,5,0"
                                 />
                    </StackPanel>
                </Button>

                <Button Margin="5,5,0,5" Click="ButtonCancel_Click">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text=" Cancel " />
                        <Image
                                Stretch="None"
                                Source="{StaticResource IconCancel}"
                                Margin="0,0,5,0"
                                 />
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
        <QuailControls:ProcessingModalControl Text="{Binding ProcessingText}"
                    ModalVisibility="{Binding IsProcessing, Converter={StaticResource VisibilityConverter}}" />
    </Grid>
</UserControl>
